﻿@model IEnumerable<e_commerce.Foreground.Models.Order>

@{
    ViewBag.Title = "订单中心";
}

<section class="order-wrap">
    <div class="layui-tab layui-tab-brief" lay-filter="unpaid">
        <ul class="layui-tab-title">
            <li class="layui-this">全部订单</li>
            <li>待付款</li>
            <li>待发货</li>
            <li>已发货</li>
            <li>完结订单</li>
        </ul>
        <div class="tab-head">
            <span class="w50">订单明细</span>
            <span class="w125">商品物流</span>
            <span class="w125">实付金额</span>
            <span class="w125">状态</span>
            <span class="w125">操作</span>
        </div>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                @if (Model.Count() == 0)
                {
                    <div class="no-data"><img src="~/Image/noData.png" /></div>
                }
                else
                {
                    foreach (var item in Model)
                    {
                        @Html.Partial("ViewComponents/Order", item)
                    }
                }
            </div>
            <div class="layui-tab-item">
                
            </div>
            <div class="layui-tab-item">
                
            </div>
            <div class="layui-tab-item">
               
            </div>
            <div class="layui-tab-item">
               
            </div>
        </div>
    </div>
</section>

@section Styles{
    <link href="~/CSS/orderlist.css" rel="stylesheet" />
}

@section Scripts{
    <script type="text/x-jsrender" id="order_template">
        <div class="order">
            <div class="order-message-top">
                <span style="color:#bdbdbd;">下单时间 : </span><span class="order-time">{{:CreateTime}}</span>
                <span style="color:#bdbdbd;">订单号 : </span><span class="order-id">{{:OrderId}}</span>
            </div>
            <div class="order-message">
                <div class="goods-name w50">
                    <img style="height:80px;width:80px;" src="{{:Icon}}" />
                    {{:GoodsName}} × {{:Count}}
                </div>
                <div class="goods-diver w125">无</div>
                <div class="order-price w125">￥{{:Price}}</div>
                <div class="order-state w125">{{:State}}</div>
                <div class="order-op w125">
                    <input type="hidden" value="{{:OrderId}}" />
                    @*{{if  :StateBar === 1}}
                    {
                    <a href="/Page/PayOrder?orderId={{:OrderId}}">前去支付</a>
                    }
                    {{else  :StateBar === 2}}
                    {

                    }
                    {{else  :StateBar === 3}}
                    {
                    <button type="button" class="get-order-bt">确认收货</button>
                    }
                    {{else  :StateBar === 4}}
                    {
                    <button type="button" class="get-order-bt">确认收货</button>
                    }
                    {{/if}}*@
                    <a href="/ClientCenter/OrderDetail?orderId={{:OrderId}}">查看详情</a>
                </div>
            </div>
        </div>
    </script>
    <script src="~/JS/OrderList.js"></script>

}